<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
	</head>
	<body>
		<div id="app">
			<h1>{{firstName|upperCase|capitalize}}</h1>
		</div>
		<script type="text/javascript">
			Vue.filter('capitalize', function(value) {
				if (!value) return ''
				value = value.toString()
				return value.charAt(0).toLowerCase() + value.slice(1)
			})
			let vm = new Vue({
				el: '#app',
				data: {
					firstName: 'zhangsan'
				},
				filters: {
					upperCase: function(val) {
						return val.toUpperCase();
					}
				}
			})
		</script>
	</body>
</html>
